package com.xjscrm.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum TradeTypeEnum {

    PAY(3001, "交易中"),
    REFUND(3002, "退款"),
    ;

    private final Integer value;
    private final String desc;


    public static TradeTypeEnum getValue(Integer value) {

        for (TradeTypeEnum tradeEnum : TradeTypeEnum.values()) {
            if (Objects.equals(value, tradeEnum.getValue())) {
                return tradeEnum;
            }
        }
        return null;
    }
}
